import { IApplicationModel, IAssetsModel, IClubFormModel, IClubModel, IUserModel } from "./model.h";

export enum ReqApiUrls {
    AccountAndPwd = '/authorize/self/ap',
    SelfInfo = '/authorize/self',
    SelfClubs='/user/self/club',
    SelfClub = '/user/self/club/single/:clubID',
    Users='/user',
    UserSaerch='/user/search',
    UserInfo = '/user/single/:userID',
    Roles = '/user/self/role',
    CheckRole='/user/self/role/check',
    OtherRoles = '/user/single/:userID/role',
    OtherInfo = '/user/single/:userID',
    Clubs = '/club',
    Club='/club/:clubID',
    ClubSearch='/club/search',
    ClubApplications = '/club/:clubID/application',
    AcceptClubApplication = '/club/:clubID/application/:applicationID/accept',
    StatsClubApplication = '/club/:clubID/application/:applicationID/flow',
    RejectClubApplication = '/club/:clubID/application/:applicationID/reject',
    ResetClubApplication = '/club/:clubID/application/:applicationID/reset',
    ClubForms ='/club/:clubID/form',
    ClubJoinForm='/club/:clubID/join',
    ClubForm='/club/:clubID/form/single/:formID',
    ClubInviteLinks='/club/:clubID/invite/link',
    ClubInviteLink= '/club/:clubID/invite/link/:inviteID',
    ClubPage='/club/:clubID/page',
    SelfApplication='/user/self/application/single/:applicationID',
    Invite = '/invite/:inviteID',
    Form = '/form/:formID',
    FormApplications = '/form/:formID/application',
    FormStatus = '/form/:formID/status',
    FormApplication = '/form/:formID/application/single/:applicationID',
    ClubMessages = '/message/club/:clubID',
    SelfAllClubMessages = '/message/self/club',
    SelfReciveMessages = '/message/self/received',
    SelfSendedMessages = '/message/self/send',
    Message = '/message/single/:messageID',
    ReadMessage='/message/single/:messageID/read',
    SendUserMessage = '/message/user/:userID',
    RegistryAp = '/registry/ap',
    Assets='/assets'
}
export interface IPagination<T> {
    items:T[]
    total_count:number,
    page_info:{
        has_next_page:boolean,
        has_prev_page:boolean,
        current_page:number,
        current_size:number
    }
}

export interface IPaginationReq {
    page?:number
    size:number
}
export interface ICheckRoleRes {
    admin:boolean
    leader:boolean
    student:boolean
}


export interface IGetAllClubsReq extends IPaginationReq {

}
export interface IGetAllClubsRes extends IPagination<IClubModel> {

}

export interface ICreateClubReq {
    name:string
    primary_color:string
    address?:string
    location?:string
    introduction?:string
    favicon_id?:number
    page_id?:number
}

export interface ICreateClubRes extends IClubModel {

}

export interface IUpdateClubReq {
    club_id:number
    name:string
    primary_color:string
    address?:string
    location?:string
    introduction?:string
    favicon_id?:number
    page_id?:number
}

export interface IUpdateClubRes extends IClubModel {

}

export interface IDeleteClubReq {
    club_id:number
}
export interface IGetClubPageReq {
    club_id:number
}
export interface IUpsertClubPageReq {
    club_id:number
    title:string
    content_text:string
    content:{
        html:string
        json:any
        type:"html"|"json"
    }
}

export interface IGetAllClubFormReq extends IPaginationReq {
    club_id:number
}
export interface IGetAllClubFormRes extends IPagination<IClubFormModel> {

}
export interface IGetAllClubApplicationReq extends IPaginationReq {
    club_id:number
}
export interface IGetAllClubApplicationRes extends IPagination<IApplicationModel> {

}



export interface IGetAllAssetsReq extends IPaginationReq {

}
export interface IGetAllAssetsRes extends IPagination<IAssetsModel> {

}
export interface IUploadAssetsReq {
    file:File
}

export interface IGetAllUserReq extends IPaginationReq {

}
export interface IGetAllUserRes extends IPagination<IUserModel> {

}
export interface ISearchUserReq extends IPaginationReq {
    where:Record<string,any>
}
export interface ISearchUserRes extends IPagination<IUserModel> {

}

export interface ISearchClubReq extends IPaginationReq {
    where:Record<string,any>
}

export  interface ISearchClubRes extends IPagination<IClubModel> {

}

export interface IGetClubReq {
    club_id:number
}
